package com.sinocare.dict.service.impl;

import com.sinocare.common.entity.*;
import com.sinocare.dict.mapper.PatientMapper;
import com.sinocare.dict.service.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PatientServiceImpl implements PatientService {

    @Autowired
    private PatientMapper patientMapper;

    /**
     * 查询检测者列表信息
     * @param patient
     * @return
     */
    @Override
    public List<Patient> queryPatient(Patient patient) {
        return patientMapper.queryPatient(patient);
    }

    /**
     * 所属分店下拉列表从数据库获取数据
     * @return
     */
    @Override
    public List<Store> queryStoreName() {
        return patientMapper.queryStoreName();
    }

    /**
     * 新增检测者
     * @param patient
     * @return
     */
    @Override
    public int addPatient(Patient patient) {
        return patientMapper.addPatient(patient);
    }

    /**
     * 修改检测者信息
     * @param patient
     * @return
     */
    @Override
    public int alterPatient(Patient patient) {
        return patientMapper.alterPatient(patient);
    }

    /**
     * 删除/禁用检测者
     * @param patientId
     * @return
     */
    @Override
    public int deletePatient(Integer patientId) {
        return patientMapper.deletePatient(patientId);
    }

    /**
     * 新增检测(检测值)
     * @param medicalResult
     * @return
     */
    @Override
    public int addMedicalResult(MedicalResult medicalResult) {
        return patientMapper.addMedicalResult(medicalResult);
    }

    /**
     * 修改（添加）检测者的体重&身高
     * @param patient
     * @return
     */
    @Override
    public int alterBMI(Patient patient) {
        return patientMapper.alterBMI(patient);
    }

    /**
     * 查询检查次数和最后检测时间
     * @param patient
     * @return
     */
    @Override
    public List<Patient> queryCountTest() {
        return patientMapper.queryCountTest();
    }

    /**
     * 查询检测报告信息
     * @param reportList
     * @return
     */
    @Override
    public List<ReportList> questReportList(ReportList reportList) {
        return patientMapper.questReportList(reportList);
    }


}
